﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="registe.aspx.cs" Inherits="registe" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>注册</title>
    <link rel="Stylesheet" type="text/css" href="Style/StyleSheet.css" />
    <style type="text/css">
     .code {  
           background-image:url(code.jpg);  
           font-family:Arial;  
           font-style:italic;  
           color:Red;  
           border:0;  
           letter-spacing:3px;  
           font-weight:bolder;  
       }  
     .unchanged  {  
           border:0;  
       }   
        .style1
        {
            font-family: 仿宋;
            font-size: xx-large;
            color: #FFFFFF;
        }
        .style2
        {
            color: #0099FF;
        }
        .style3
        {
            color: #0099FF;
            font-weight: bold;
        }
        #XXX
        {
            width: 76px;
        }
    </style>
    <script language="javascript" type="text/javascript">  

        var code ; //在全局 定义验证码  
        function createCode()  
        {   
          code = "";  
          var codeLength = 4;//验证码的长度  
          var checkCode = document.getElementById("checkCode");  
          var selectChar = new  Array(0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');// 所有候选组成验证码的字符，当然也可以用中文的  
              
          for(var i=0;i<codeLength;i++){                        
             var charIndex = Math.floor(Math.random()*36);  
             code +=selectChar[charIndex];           
          }  

          if(checkCode)  
          {  
            checkCode.className="code";  
            checkCode.value = code;  
          }           
        }  
        function checkVerifyCode()  
        {  
          var inputCode = document.getElementById("verifyCodeID").value ;  
       
          if(inputCode.toLowerCase() != code.toLowerCase() )  
          {  
    		 alert("错误的验证码！"); 
    		 document.getElementById('verifyCodeID').value='';
             createCode();//刷新验证码  
          } 
          else{ }
        }  
        
        function checkJs(boolvalue)
        {
            document.getElementById('insertButton').disabled = !boolvalue;                        
        }


       </script>  
</head>
<body onload="createCode()">
    <form id="form1" runat="server">
      <div style="width:800px; height:600px; margin:0 auto; margin-top:30px; border-bottom:solid 1px #0099FF; border-left:solid 1px #0099FF; border-right:solid 1px #0099FF;">
        <div style="height:40px; background-color:#0099FF" class="style1">欢迎注册巅峰书城账号！</div>
        <asp:Panel ID="first" runat="server">
          <div style=" margin-top:20px" class="style2">
              <b>创建账号 </b>
          </div>
          <div>
            <img src="image/underline.jpg" alt="" />
          </div>
          <table style="margin:0 auto;width:400px">
            <tr>
              <td style="">
             会员名
              </td>
              <td>
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="TextBox1" ErrorMessage="不能为空" runat="server"></asp:RequiredFieldValidator>
              </td>
            </tr>
            <tr>
              <td>登录密码</td>
              <td>
                <asp:TextBox ID="TextBox2" TextMode="Password" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="TextBox2" ErrorMessage="不能为空" runat="server"></asp:RequiredFieldValidator>
              </td>
            </tr>
            <tr>
              <td>确认密码</td>
              <td>
                <asp:TextBox ID="TextBox3"  TextMode="Password" runat="server"></asp:TextBox>
                <asp:CompareValidator ID="CompareValidator1" ControlToCompare="TextBox2" ControlToValidate="TextBox3" ErrorMessage="密码不一样" runat="server"></asp:CompareValidator>
              </td>
            </tr>
            <tr>
               <td>验证码
               </td>
               <td>
                 <asp:TextBox id="verifyCodeID" runat="server" onblur="checkVerifyCode();"></asp:TextBox>
			     <input style="border-style: none; border-color: inherit; border-width: 0; cursor:pointer; width:55px; " 
                       type="text" onclick="createCode()" readonly="readonly" id="checkCode" 
                       class="unchanged" size="4"/>&nbsp;<a style="cursor:pointer" onclick="createCode();">看不清？</a>
               </td>
            </tr>
          </table>
          <div>
          </div>
        </asp:Panel>
      
        <asp:Panel ID="second" runat="server">
           <div style="margin-top:20px" class="style3">安全信息</div>
           <div>
                <img src="image/underline.jpg" alt="" />
           </div>
           <table style="margin:0 auto; width:400px">
              <tr>
                <td>邮箱</td>
                <td>
                  <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
                  
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                        ControlToValidate="TextBox4" ErrorMessage="RegularExpressionValidator" 
                        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                  
                </td>
              </tr>
              <tr>
                <td>安全问题</td>
                <td>
                  <select name="secproblem" id="secproblem" runat="server"  >
                    <option style="color:#666" value="0">请选择密码提示问题</option>
                    <option value="您母亲的姓名是?">您母亲的姓名是?</option>
                    <option value="您父亲的姓名是?">您父亲的姓名是?</option>
                    <option value="您配偶的姓名是?">您配偶的姓名是?</option>
                    <option value="您母亲的生日是?">您母亲的生日是?</option>
                    <option value="您父亲的生日是?">您父亲的生日是?</option>
                    <option value="您配偶的生日是?">您配偶的生日是?</option>
                    <option value="您的出生地是?">您的出生地是?</option>
                    <option value="您的小学校名是?">您的小学校名是?</option>
                    <option value="您的中学校名是?">您的中学校名是?</option>
                    <option value="您的大学校名是?">您的大学校名是?</option>
                  </select>
                </td>
              </tr>
              <tr>
                <td>安全问题答案</td>
                <td>
                 <asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
                </td>
              </tr>
           </table>
           <div style="margin-top:20px" class="style2"><b>服务条款</b></div>
           <div>
                <img src="image/underline.jpg" alt="" />
           </div>
           <div style="margin-top:20px;text-align:center">
             <asp:CheckBox ID="IsAgree" Text="我已阅读并接受" onclick='checkJs(this.checked);' runat="server" />“
             <a href="#" onclick="javascript:window.open('DFServerTerm.htm','popuge', 'height=800, width=700')">巅峰书城服务条款"</a>
             
           </div>
           <div style="text-align:center; margin-top:50px">
                <asp:Button ID="insertButton" Enabled="false" Text="快速注册" runat="server" 
                    onclick="insertButton_Click" />
           </div>
           
        </asp:Panel>
      </div>
    </form>
</body>
</html>
